package com.fjec.market.feign;

import com.fjec.common.view.AnnexBizItem;
import com.fjec.market.feign.config.FeignConfig;
import com.fjec.market.feign.fallback.BaseClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(name = "base-serv", fallback = BaseClientFallback.class, configuration = FeignConfig.class)
public interface BaseClient {
    @RequestMapping(method = RequestMethod.GET, value = "/api/annex/get")
    Map<String, Object> getIndexPics(@RequestParam("bizType") int bizType);

    @RequestMapping(method = RequestMethod.POST, value = "/api/annex/available/set")
    int enableAnnexStatus(@RequestBody List<AnnexBizItem> itemList);

    /**
     * 获取系统参数
     *
     * @return
     */
    @RequestMapping(method = RequestMethod.GET, value = "/api/setting/get")
    Map<String, Object> getSysSetting();

    /**
     * 根据Id获取文件Base64
     *
     * @param id
     * @return
     */
    @RequestMapping(method = RequestMethod.GET, value = "/api/annex/secret/base64/get")
    Map<String, Object> getOSSFileBase64ById(@RequestParam("id") Long id);

    /**
     * 根据bizType bizId，如果有多个只取第一个
     *
     * @param bizId
     * @param bizType
     * @return
     */
    @RequestMapping(method = RequestMethod.GET, value = "/api/annex/secret/base64/map")
    Map<String, Object> getSecretFileBase64Map(@RequestParam("bizId") Long bizId,
                                  @RequestParam("bizType") Integer bizType);

}
